﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/BackEndFashion.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<Fashion.Models.ProductImage>>" %>
<%@ Import Namespace="A" %>
<%@ Import Namespace="Fashion.Common.Const" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    ViewImages
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        ViewImages</h2>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <th>
                Preview
            </th>
            <th>
                IsMain
            </th>
            <th>
                Active
            </th>
            <th>
            </th>
        </tr>
        <%foreach (var productImage in Model){%>
            <tr>
                <td><img src="<%=productImage.FilePath %>" alt="Alternate Text" width="50px" height="50px" /></td>
                <td align="center"><%=Html.ActionLink(ParameterTemplate.Image, "SetMainImage", new {id=productImage.Id,productId = productImage.ProductId}).DisplayActionLinkByImageActive(productImage.IsMain)%></td>
                <td align="center"><%=productImage.Active.DisplayIconActive() %></td>
                <td>
                    <%=Html.ActionLink(ParameterTemplate.Image, "DeleteImage", new { id = productImage.Id, productId = productImage.ProductId }, new { onclick = "return confirm('Are you sure you wish to delete this record?');" }).DisplayActionLinkByImage(HtmlCode.ImgIconDelete)%>
                </td>
            </tr>
        <%} %>
        <tr>
            <td colspan="4">
                <%Html.RenderPartial("UsrUploadImage", ViewData[ViewDataName.ProductId]); %>
            </td>
        </tr>
    </table>  
</asp:Content>
